]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
powerProfiles: Avoid warnings on missing power-profiles-daemon
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 20 Oct 2022 11:04:18 +0000 (13:04 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 20 Oct 2022 11:55:06 +0000 (13:55 +0200)
GDBusProxy transparently handles the remote object appearing and
vanishing. It is therefore not an error if the service is not
running at the time the proxy is initialized, so we proceed and
try to read the list of profiles which is null in that case,
resulting in (harmless but annoying) warnings.

Avoid this by only reading the initial list of profiles if the
service has a name owner.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5992

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2518>

js/ui/status/powerProfiles.js

index 43f6ce93f3b7adefd0cf837bde3380bd7099f697..e15208d8ffb9e75cdaeebcf9c9c2f7dec356d036 100644 (file)
@@ -58,7 +58,9 @@ class PowerProfilesToggle extends QuickMenuToggle {
                             this._syncProfiles();
                         this._sync();
                     });
-                    this._syncProfiles();
+
+                    if (this._proxy.g_name_owner)
+                        this._syncProfiles();
                 }
                 this._sync();
             });